<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <title>2.组件</title>
    </head>
    <body>
        <div id="root"></div>

    <script src="../day01/lib/react.development.js"></script>
    <script src="../day01/lib/react-dom.development.js"></script>
    <script src="../day01/lib/babel.js"></script>

    <script type="text/babel">
        //创建组件的两种方式
        //组件使用时要写标签形式
        //1.class => 类组件    extends 继承
        //首字母要大写    类组件必须继承 React.Component
        class MyComponent extends React.Component{
            render(){
                //render方法 renter的结果,就是当前组件渲染的内容
                return <div>MyComponent</div>
            }
        }
        ReactDOM.creatRoot(document.getElementById('root')).render(<MyComponent/>)
    </script>
    </body>
</html>